package fun.sanguo.mapper.record;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import fun.sanguo.model.dto.PageQuery;
import fun.sanguo.model.entity.record.RecordPeriodEntity;
import fun.sanguo.utils.sqlBuilder.SqlBuilderRecordPeriod;

import java.util.List;

/**
 * 时期表 Mapper接口
 *
 * @author ZYP
 * @date 2023-04-25
 */
@Mapper
public interface RecordPeriodMapper {

    /**
     * 查询总量
     *
     * @param recordPeriodEntity
     * @return
     */
    @SelectProvider(type = SqlBuilderRecordPeriod.class, method = "getTotal")
    int getTotal(RecordPeriodEntity recordPeriodEntity);

    /**
     * 查询列表
     *
     * @param recordPeriodEntity
     * @param pageQuery
     * @return
     */
    @SelectProvider(type = SqlBuilderRecordPeriod.class, method = "getList")
    List<RecordPeriodEntity> getList(RecordPeriodEntity recordPeriodEntity, PageQuery pageQuery);

    /**
     * 新增
     *
     * @param recordPeriodEntity
     * @return
     */
    @InsertProvider(type = SqlBuilderRecordPeriod.class, method = "insert")
    Integer insert(RecordPeriodEntity recordPeriodEntity);

    /**
     * 编辑
     *
     * @param recordPeriodEntity
     * @return
     */
    @UpdateProvider(type = SqlBuilderRecordPeriod.class, method = "update")
    Integer update(RecordPeriodEntity recordPeriodEntity);

    /**
     * 删除
     *
     * @param recordPeriodEntity
     * @return
     */
    @UpdateProvider(type = SqlBuilderRecordPeriod.class, method = "delete")
    Integer delete(RecordPeriodEntity recordPeriodEntity);
}
